<template>
  <div>
    <h2>{{message}}</h2>
    <p>newid:{{$route.params.newsId}}</p>
    <p>{{$route.params.newsTitle}}</p>
  </div>
</template>

<script>
  export default {
    name: "params",
    data() {
      return {
        message: 'hello params'
      }
    },
    //钩子函数  进入模板
    beforeRouteEnter: (to, form, next) => {
      console.log('进入模板')
      next();
    },
    //钩子函数  离开模板
    beforeRouteLeave: (to, form, next) => {
      console.log('离开模板')
      next();
    }
  }
</script>

<style scoped>

</style>
